/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.restaurant.domain;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author root
 */
@Entity
@Table(name = "menu")
@XmlRootElement(name = "menu")
@NamedQueries({
    @NamedQuery(name = "Menu.findAll", query = "SELECT m FROM Menu m"),
    @NamedQuery(name = "Menu.findByMenuID", query = "SELECT m FROM Menu m WHERE m.menuID = :menuID"),
    @NamedQuery(name = "Menu.findByMenuname", query = "SELECT m FROM Menu m WHERE m.menuname = :menuname"),
    @NamedQuery(name = "Menu.findByIsdeleted", query = "SELECT m FROM Menu m WHERE m.isdeleted = :isdeleted"),
    @NamedQuery(name = "Menu.findBySidedishlinage", query = "SELECT m FROM Menu m WHERE m.sidedishlinage = :sidedishlinage"),
    @NamedQuery(name = "Menu.findByDeleteddate", query = "SELECT m FROM Menu m WHERE m.deleteddate = :deleteddate"),
    @NamedQuery(name = "Menu.findByLastupdationdate", query = "SELECT m FROM Menu m WHERE m.lastupdationdate = :lastupdationdate"),
    @NamedQuery(name = "Menu.findByImagepath", query = "SELECT m FROM Menu m WHERE m.imagepath = :imagepath"),
    @NamedQuery(name = "Menu.findByPrice", query = "SELECT m FROM Menu m WHERE m.price = :price")})
public class Menu implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "MenuID")
    private Long menuID;
    @Column(name = "menuname")
    private String menuname;
    @Column(name = "isdeleted")
    private Boolean isdeleted;
    @Column(name = "sidedishlinage")
    private String sidedishlinage;
    @Column(name = "deleteddate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date deleteddate;
    @Column(name = "lastupdationdate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastupdationdate;
    @Column(name = "imagepath")
    private String imagepath;
    @Column(name = "iconpath")
    private String iconpath;
    @Column(name = "price")
    private Double price;
    @Column(name = "description")
    private String description;
    @JoinColumn(name = "menucategory_MenucategoryID", referencedColumnName = "MenucategoryID")
    @ManyToOne(optional = false)
    private Menucategory menucategory;
    @JoinColumn(name = "foodtype_FoodTypeID", referencedColumnName = "FoodTypeID")
    @ManyToOne(optional = false)
    private Foodtype foodtype;
    @JoinColumn(name = "employee_EmployeeID_deletedby", referencedColumnName = "EmployeeID")
    @ManyToOne
    private Employee employee;
    @JoinColumn(name = "employee_EmployeeID_updatedby", referencedColumnName = "EmployeeID")
    @ManyToOne
    private Employee employee1;
    
    @Transient
    private String alreadyExists;
    
    public String getAlreadyExists() {
		return alreadyExists;
	}

	public void setAlreadyExists(String alreadyExists) {
		this.alreadyExists = alreadyExists;
	}

	public Menu() {
    }

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Menu(Long menuID) {
        this.menuID = menuID;
    }

    public Long getMenuID() {
        return menuID;
    }

    public void setMenuID(Long menuID) {
        this.menuID = menuID;
    }

    public String getMenuname() {
        return menuname;
    }

    public void setMenuname(String menuname) {
        this.menuname = menuname;
    }

    public Boolean getIsdeleted() {
        return isdeleted;
    }

    public void setIsdeleted(Boolean isdeleted) {
        this.isdeleted = isdeleted;
    }

    public String getSidedishlinage() {
        return sidedishlinage;
    }

    public void setSidedishlinage(String sidedishlinage) {
        this.sidedishlinage = sidedishlinage;
    }

    public Date getDeleteddate() {
        return deleteddate;
    }

    public void setDeleteddate(Date deleteddate) {
        this.deleteddate = deleteddate;
    }

    public Date getLastupdationdate() {
        return lastupdationdate;
    }

    public void setLastupdationdate(Date lastupdationdate) {
        this.lastupdationdate = lastupdationdate;
    }

    public String getImagepath() {
        return imagepath;
    }

    public void setImagepath(String imagepath) {
        this.imagepath = imagepath;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Menucategory getMenucategory() {
        return menucategory;
    }

    public void setMenucategory(Menucategory menucategory) {
        this.menucategory = menucategory;
    }

    public Foodtype getFoodtype() {
        return foodtype;
    }

    public void setFoodtype(Foodtype foodtype) {
        this.foodtype = foodtype;
    }

    public Employee getEmployee() {
        return employee;
    }

    public void setEmployee(Employee employee) {
        this.employee = employee;
    }

    public Employee getEmployee1() {
        return employee1;
    }

    public void setEmployee1(Employee employee1) {
        this.employee1 = employee1;
    }
    
    public String getIconpath() {
		return iconpath;
	}

	public void setIconpath(String iconpath) {
		this.iconpath = iconpath;
	}

	@Override
    public int hashCode() {
        int hash = 0;
        hash += (menuID != null ? menuID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Menu)) {
            return false;
        }
        Menu other = (Menu) object;
        if ((this.menuID == null && other.menuID != null) || (this.menuID != null && !this.menuID.equals(other.menuID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.restaurant.domain.Menu[menuID=" + menuID + "]";
    }

}
